<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>QCNSim: QcnSim/Node.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">QCNSim
   </div>
   <div id="projectbrief">Simulator for Quake-Catcher Network</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d21be12960473ba5c51e5f9beea3525e.html">QcnSim</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">Node.cpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_node_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_node_8h.html">Node.h</a>&quot;</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;</div>
<div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="class_node.html#aa433297c5f2e8f74c5a999e429eada60">   30</a></span>&#160;<a class="code" href="class_node.html#aa433297c5f2e8f74c5a999e429eada60">Node::Node</a>(<a class="code" href="class_simulator_globals.html">SimulatorGlobals</a> &amp;simulatorGlobals): receivedBytesCount(0), receivedPdusOrTokensCount(0), forwardedPdusOrTokensCount(0), forwardedBytesCount(0), droppedPdusOrTokensCount(0),</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;        lastDelay(0.0), sumDelay(0.0), meanDelay(0.0), lastJitter(0.0), sumJitter(0.0), meanJitter(0.0), previousDelay(0.0), simulatorGlobals(simulatorGlobals) {</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;}</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div>
<div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="class_node.html#a9a3aa1e2c2fff5cc94cb0abc36f07d31">   42</a></span>&#160;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_node.html#a9a3aa1e2c2fff5cc94cb0abc36f07d31">Node::getReceivedBytesCount</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_node.html#af48f6ec6fd6ea43523f139c5d5ff3cdd">receivedBytesCount</a>;</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;}</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;</div>
<div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="class_node.html#a4b1e673f06404a5197429a352c2154b2">   51</a></span>&#160;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_node.html#a4b1e673f06404a5197429a352c2154b2">Node::getReceivedPdusOrTokensCount</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_node.html#a15b31ec3be471e9e046f48517e2963aa">receivedPdusOrTokensCount</a>;</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;}</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;</div>
<div class="line"><a name="l00060"></a><span class="lineno"><a class="line" href="class_node.html#a56b7b2497ac364efe0719ea219d98b9e">   60</a></span>&#160;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_node.html#a56b7b2497ac364efe0719ea219d98b9e">Node::getForwardedPdusOrTokensCount</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_node.html#a0fb081dd5928c91756f9faf672dafb35">forwardedPdusOrTokensCount</a>;</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;}</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;</div>
<div class="line"><a name="l00069"></a><span class="lineno"><a class="line" href="class_node.html#a3dada83d831807c17f41b76395759c6e">   69</a></span>&#160;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_node.html#a3dada83d831807c17f41b76395759c6e">Node::getForwardedBytesCount</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_node.html#a3423410395300339105d6148290148cc">forwardedBytesCount</a>;</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;}</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;</div>
<div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="class_node.html#a31099ef50497ea806ea588c879ef22e1">   78</a></span>&#160;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_node.html#a31099ef50497ea806ea588c879ef22e1">Node::getDroppedPdusOrTokensCount</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_node.html#a6a54b09eb2ba1cc137ab23a4766c4960">droppedPdusOrTokensCount</a>;</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;}</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;</div>
<div class="line"><a name="l00087"></a><span class="lineno"><a class="line" href="class_node.html#a20dfdbde07dfa9499ba12c66407ef696">   87</a></span>&#160;<span class="keywordtype">double</span> <a class="code" href="class_node.html#a20dfdbde07dfa9499ba12c66407ef696">Node::getLastPduOrTokenDelay</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_node.html#a35475c10b6c54bc85c2ce15fb5ea042d">lastDelay</a>;</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;}</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;</div>
<div class="line"><a name="l00096"></a><span class="lineno"><a class="line" href="class_node.html#a6f36f9c793310fa1342479d3ee99afcf">   96</a></span>&#160;<span class="keywordtype">double</span> <a class="code" href="class_node.html#a6f36f9c793310fa1342479d3ee99afcf">Node::getSumPduOrTokenDelay</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_node.html#a579cc4fb0789a1de48fb56ae99d7385a">sumDelay</a>;</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;}</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;</div>
<div class="line"><a name="l00105"></a><span class="lineno"><a class="line" href="class_node.html#aea1a8c07cd8b785dcd2d872392b9e630">  105</a></span>&#160;<span class="keywordtype">double</span> <a class="code" href="class_node.html#aea1a8c07cd8b785dcd2d872392b9e630">Node::getMeanPduOrTokenDelay</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_node.html#ae133a5c3fc82ca150ff95a0ac0a5da86">meanDelay</a>;</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;}</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;</div>
<div class="line"><a name="l00114"></a><span class="lineno"><a class="line" href="class_node.html#a3f388ac2e7209056fbc0988419b1d667">  114</a></span>&#160;<span class="keywordtype">double</span> <a class="code" href="class_node.html#a3f388ac2e7209056fbc0988419b1d667">Node::getLastPduOrTokenJitter</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_node.html#aec183b66f5f92e8cae4f3a1269e1316c">lastJitter</a>;</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;}</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;</div>
<div class="line"><a name="l00123"></a><span class="lineno"><a class="line" href="class_node.html#a95ef71aa24da2ed22f1da017d27602ac">  123</a></span>&#160;<span class="keywordtype">double</span> <a class="code" href="class_node.html#a95ef71aa24da2ed22f1da017d27602ac">Node::getSumPduOrTokenJitter</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_node.html#a4a5f15b9aed15145bbe65b61a30cdc67">sumJitter</a>;</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;}</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;</div>
<div class="line"><a name="l00132"></a><span class="lineno"><a class="line" href="class_node.html#abe5523d6e76ecfec5bd09ca388ee5873">  132</a></span>&#160;<span class="keywordtype">double</span> <a class="code" href="class_node.html#abe5523d6e76ecfec5bd09ca388ee5873">Node::getMeanPduOrTokenJitter</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_node.html#a35637af5cd80cfe72376d43f16b64f19">meanJitter</a>;</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;}</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;</div>
<div class="line"><a name="l00149"></a><span class="lineno"><a class="line" href="class_node.html#a2cb2a58f1d3477a30e863e59b1dbc3e2">  149</a></span>&#160;<a class="code" href="_node_return_type_8h.html#a653f4b3757de7a3613c60211493c60c1">NodeReturnType</a> <a class="code" href="class_node.html#a2cb2a58f1d3477a30e863e59b1dbc3e2">Node::processAndForward</a>(std::shared_ptr&lt;Token&gt; token) {</div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;    <span class="comment">// No check for TTL needed in Token, just for PDUs.</span></div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;</div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;    <span class="comment">// Is this the destination node AND the first time the token arrives here? If true, update stats and do nothing else.</span></div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;    <span class="keywordflow">if</span> (token-&gt;destination.get() == <span class="keyword">this</span> &amp;&amp; token-&gt;previous.get() != <span class="keyword">this</span>) { <span class="comment">// Need to compare addresses here! Or maybe a comparator? Nah.</span></div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;        <span class="comment">// Call the record route function; the hop will only be effectively recorded if the recordRoute is set within the Route object.</span></div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;        <span class="comment">// Calling this function without prior checking of the flag is therefore safe.</span></div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;        token-&gt;addHopToRecordedRoute(shared_from_this()); <span class="comment">// need smart pointer of self reference here!</span></div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;        <a class="code" href="class_node.html#ac5b0a78b84737a4bf4adffbcbc0755ab">updateArrivalStatistics</a>(token);</div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;        <span class="comment">// Update token previous field to this node. Leave other fields untouched.</span></div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;        token-&gt;previous = shared_from_this();</div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="_node_return_type_8h.html#a653f4b3757de7a3613c60211493c60c1ab9804cb278b1f322f56a216720a67eec">NodeReturnType::FINAL_DESTINATION</a>;</div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (token-&gt;destination.get() == <span class="keyword">this</span> &amp;&amp; token-&gt;previous.get() == <span class="keyword">this</span>) {</div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;        <span class="comment">// If this node is the destination and token has been here (received) just before, do nothing.</span></div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="_node_return_type_8h.html#a653f4b3757de7a3613c60211493c60c1ab9804cb278b1f322f56a216720a67eec">NodeReturnType::FINAL_DESTINATION</a>;</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;        <span class="comment">// This is not the destination node. Forward the token to the next hop by modifying the appropriate token fields.</span></div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;        <span class="comment">// Do not deal with TTL here; leave it for PDU types.</span></div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;        token-&gt;addHopToRecordedRoute(shared_from_this()); <span class="comment">// need smart pointer of self reference here!</span></div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;        <span class="comment">// Sanity check; if the return type is not PDU_ROUTE_UPDATED, there is some inconsistency in the route table or unpredicted bug.</span></div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;        <span class="keywordflow">if</span> (<a class="code" href="class_node.html#ae9f5e321e4dfb45e444e007607867737">updateForwardHops</a>(token) != <a class="code" href="_node_return_type_8h.html#a653f4b3757de7a3613c60211493c60c1a6491ac1bf9f296c0bd614d1b182f8932">NodeReturnType::PDU_ROUTE_UPDATED</a>) {</div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;            std::cout &lt;&lt; <span class="stringliteral">&quot;Node::processAndForward(token): Inconsistency in routing path. Aborting...&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;            exit(1);</div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;        }</div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;        <a class="code" href="class_node.html#ac5b0a78b84737a4bf4adffbcbc0755ab">updateArrivalStatistics</a>(token);</div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;        <a class="code" href="class_node.html#af7467aafc77bd9d430ca329e931ade5a">updateForwardingStatistics</a>(token);</div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="_node_return_type_8h.html#a653f4b3757de7a3613c60211493c60c1a6491ac1bf9f296c0bd614d1b182f8932">NodeReturnType::PDU_ROUTE_UPDATED</a>;</div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;    }</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;}</div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;</div>
<div class="line"><a name="l00192"></a><span class="lineno"><a class="line" href="class_node.html#ad8b8197c396ed400575990c2d8609c28">  192</a></span>&#160;<a class="code" href="_node_return_type_8h.html#a653f4b3757de7a3613c60211493c60c1">NodeReturnType</a> <a class="code" href="class_node.html#a2cb2a58f1d3477a30e863e59b1dbc3e2">Node::processAndForward</a>(std::shared_ptr&lt;ProtocolDataUnit&gt; pdu) {</div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;    <span class="comment">// Check for TTL; if it is zero (or less), discard PDU, record this hop to route (only if it was not recorded before), do nothing else.</span></div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;    <span class="keywordflow">if</span> (pdu-&gt;getTtl() &lt;= 0) {</div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;        <span class="keywordflow">if</span> (pdu-&gt;getRecordedRoute().back().get() != <span class="keyword">this</span>) {</div>
<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;            <span class="comment">// Only record the hop if it is not already there (case in which the explicit route has this hop more than once in a sequence).</span></div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;            pdu-&gt;addHopToRecordedRoute(shared_from_this());</div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;        }</div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;        ++<a class="code" href="class_node.html#a6a54b09eb2ba1cc137ab23a4766c4960">droppedPdusOrTokensCount</a>;</div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="_node_return_type_8h.html#a653f4b3757de7a3613c60211493c60c1a6a9d501110e3a79a73c88afceef39905">NodeReturnType::TTL_EXCEEDED_PDU_DISCARDED</a>;</div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;    }</div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;    <span class="comment">// Is this the destination node AND the first time the pdu arrives here? If true, update stats and do nothing else.</span></div>
<div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;    <span class="keywordflow">if</span> (pdu-&gt;destination.get() == <span class="keyword">this</span> &amp;&amp; pdu-&gt;previous.get() != <span class="keyword">this</span>) { <span class="comment">// Need to compare addresses here! Or maybe a comparator? Nah.</span></div>
<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;        <span class="comment">// Call the record route function; the hop will only be effectively recorded if the recordRoute is set within the Route object.</span></div>
<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;        <span class="comment">// Calling this function without prior checking of the flag is therefore safe.</span></div>
<div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;        pdu-&gt;addHopToRecordedRoute(shared_from_this()); <span class="comment">// need smart pointer of self reference here!</span></div>
<div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;        <a class="code" href="class_node.html#ac5b0a78b84737a4bf4adffbcbc0755ab">updateArrivalStatistics</a>(pdu);</div>
<div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;        <span class="comment">// Update pdu previous field to this node. Leave other fields untouched.</span></div>
<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;        pdu-&gt;previous = shared_from_this();</div>
<div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="_node_return_type_8h.html#a653f4b3757de7a3613c60211493c60c1ab9804cb278b1f322f56a216720a67eec">NodeReturnType::FINAL_DESTINATION</a>;</div>
<div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (pdu-&gt;destination.get() == <span class="keyword">this</span> &amp;&amp; pdu-&gt;previous.get() == <span class="keyword">this</span>) {</div>
<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;        <span class="comment">// If this node is the destination and pdu has been here (received) just before, do nothing.</span></div>
<div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="_node_return_type_8h.html#a653f4b3757de7a3613c60211493c60c1ab9804cb278b1f322f56a216720a67eec">NodeReturnType::FINAL_DESTINATION</a>;</div>
<div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;    } <span class="keywordflow">else</span> { <span class="comment">// Forward.</span></div>
<div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;        <span class="comment">// This is not the destination node. Forward the pdu to the next hop by modifying the appropriate pdu fields.</span></div>
<div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;        <span class="comment">// Do not deal with TTL here; leave it for PDU types.</span></div>
<div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;        pdu-&gt;addHopToRecordedRoute(shared_from_this()); <span class="comment">// need smart pointer of self reference here!</span></div>
<div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;        <span class="comment">// Sanity check; if the return type is not PDU_ROUTE_UPDATED, there is some inconsistency in the route table or unpredicted bug.</span></div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;        <span class="keywordflow">if</span> (<a class="code" href="class_node.html#ae9f5e321e4dfb45e444e007607867737">updateForwardHops</a>(pdu) != <a class="code" href="_node_return_type_8h.html#a653f4b3757de7a3613c60211493c60c1a6491ac1bf9f296c0bd614d1b182f8932">NodeReturnType::PDU_ROUTE_UPDATED</a>) {</div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;            std::cout &lt;&lt; <span class="stringliteral">&quot;Node::processAndForward(PDU): Inconsistency in routing path. Aborting...&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;            exit(1);</div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;        }</div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;        pdu-&gt;decrementTtl(); <span class="comment">// Decrement the TTL in egress.</span></div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;        <a class="code" href="class_node.html#ac5b0a78b84737a4bf4adffbcbc0755ab">updateArrivalStatistics</a>(pdu);</div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;        <a class="code" href="class_node.html#af7467aafc77bd9d430ca329e931ade5a">updateForwardingStatistics</a>(pdu);</div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="_node_return_type_8h.html#a653f4b3757de7a3613c60211493c60c1a6491ac1bf9f296c0bd614d1b182f8932">NodeReturnType::PDU_ROUTE_UPDATED</a>;</div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;    }</div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;}</div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;</div>
<div class="line"><a name="l00236"></a><span class="lineno"><a class="line" href="class_node.html#ac5b0a78b84737a4bf4adffbcbc0755ab">  236</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_node.html#ac5b0a78b84737a4bf4adffbcbc0755ab">Node::updateArrivalStatistics</a>(std::shared_ptr&lt;Token&gt; token) {</div>
<div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;    <span class="comment">// Should tokens generated from a generator attached to this node still be included in the statistics?</span></div>
<div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;    <a class="code" href="class_node.html#a9e1c05e3d8fbb3e4348418a60e512591">previousDelay</a> = <a class="code" href="class_node.html#a35475c10b6c54bc85c2ce15fb5ea042d">lastDelay</a>; <span class="comment">// Save last measured delay to allow jitter calculations for the next token received here.</span></div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;    ++<a class="code" href="class_node.html#a15b31ec3be471e9e046f48517e2963aa">receivedPdusOrTokensCount</a>;</div>
<div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;    <span class="comment">//receivedBytesCount +=</span></div>
<div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;    <a class="code" href="class_node.html#a35475c10b6c54bc85c2ce15fb5ea042d">lastDelay</a> = <a class="code" href="class_node.html#a14540911910efef23e01ec6ad881b843">simulatorGlobals</a>.<a class="code" href="class_simulator_globals.html#a08da82e86d7c26d8f2498bd313f0e66e">getCurrentAbsoluteTime</a>() - token-&gt;getAbsoluteGenerationTime();</div>
<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;    <a class="code" href="class_node.html#a579cc4fb0789a1de48fb56ae99d7385a">sumDelay</a> += <a class="code" href="class_node.html#a35475c10b6c54bc85c2ce15fb5ea042d">lastDelay</a>;</div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;    <a class="code" href="class_node.html#ae133a5c3fc82ca150ff95a0ac0a5da86">meanDelay</a> = <a class="code" href="class_node.html#a579cc4fb0789a1de48fb56ae99d7385a">sumDelay</a> / <a class="code" href="class_node.html#a15b31ec3be471e9e046f48517e2963aa">receivedPdusOrTokensCount</a>;</div>
<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;    <span class="comment">// Perform jitter calculations only if there is more than one token received here.</span></div>
<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="class_node.html#a15b31ec3be471e9e046f48517e2963aa">receivedPdusOrTokensCount</a> &gt; 1) {</div>
<div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;        <a class="code" href="class_node.html#aec183b66f5f92e8cae4f3a1269e1316c">lastJitter</a> = <a class="code" href="class_node.html#a35475c10b6c54bc85c2ce15fb5ea042d">lastDelay</a> - <a class="code" href="class_node.html#a9e1c05e3d8fbb3e4348418a60e512591">previousDelay</a>;</div>
<div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;        <a class="code" href="class_node.html#a4a5f15b9aed15145bbe65b61a30cdc67">sumJitter</a> += <a class="code" href="class_node.html#aec183b66f5f92e8cae4f3a1269e1316c">lastJitter</a>;</div>
<div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;        <a class="code" href="class_node.html#a35637af5cd80cfe72376d43f16b64f19">meanJitter</a> = <a class="code" href="class_node.html#a4a5f15b9aed15145bbe65b61a30cdc67">sumJitter</a> / (<a class="code" href="class_node.html#a15b31ec3be471e9e046f48517e2963aa">receivedPdusOrTokensCount</a> - 1); <span class="comment">// Number of measured jitters is equal to count of tokens - 1.</span></div>
<div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;    }</div>
<div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;}</div>
<div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;</div>
<div class="line"><a name="l00258"></a><span class="lineno"><a class="line" href="class_node.html#af7467aafc77bd9d430ca329e931ade5a">  258</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_node.html#af7467aafc77bd9d430ca329e931ade5a">Node::updateForwardingStatistics</a>(std::shared_ptr&lt;Token&gt; token) {</div>
<div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;    ++<a class="code" href="class_node.html#a0fb081dd5928c91756f9faf672dafb35">forwardedPdusOrTokensCount</a>;</div>
<div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;}</div>
<div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;</div>
<div class="line"><a name="l00268"></a><span class="lineno"><a class="line" href="class_node.html#aa01346a4872affb1aa40cc5e83c1a134">  268</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_node.html#ac5b0a78b84737a4bf4adffbcbc0755ab">Node::updateArrivalStatistics</a>(std::shared_ptr&lt;ProtocolDataUnit&gt; pdu) {</div>
<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;    <span class="comment">// Should PDUs generated from a generator attached to this node still be included in the statistics?</span></div>
<div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;    <a class="code" href="class_node.html#a9e1c05e3d8fbb3e4348418a60e512591">previousDelay</a> = <a class="code" href="class_node.html#a35475c10b6c54bc85c2ce15fb5ea042d">lastDelay</a>; <span class="comment">// Save last measured delay to allow jitter calculations for the next PDU received here.</span></div>
<div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;    ++<a class="code" href="class_node.html#a15b31ec3be471e9e046f48517e2963aa">receivedPdusOrTokensCount</a>;</div>
<div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;    <a class="code" href="class_node.html#af48f6ec6fd6ea43523f139c5d5ff3cdd">receivedBytesCount</a> += pdu-&gt;getPduSize();</div>
<div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;    <a class="code" href="class_node.html#a35475c10b6c54bc85c2ce15fb5ea042d">lastDelay</a> = <a class="code" href="class_node.html#a14540911910efef23e01ec6ad881b843">simulatorGlobals</a>.<a class="code" href="class_simulator_globals.html#a08da82e86d7c26d8f2498bd313f0e66e">getCurrentAbsoluteTime</a>() - pdu-&gt;getAbsoluteGenerationTime();</div>
<div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;    <a class="code" href="class_node.html#a579cc4fb0789a1de48fb56ae99d7385a">sumDelay</a> += <a class="code" href="class_node.html#a35475c10b6c54bc85c2ce15fb5ea042d">lastDelay</a>;</div>
<div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;    <a class="code" href="class_node.html#ae133a5c3fc82ca150ff95a0ac0a5da86">meanDelay</a> = <a class="code" href="class_node.html#a579cc4fb0789a1de48fb56ae99d7385a">sumDelay</a> / <a class="code" href="class_node.html#a15b31ec3be471e9e046f48517e2963aa">receivedPdusOrTokensCount</a>;</div>
<div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;    <span class="comment">// Perform jitter calculations only if there is more than one PDU received here.</span></div>
<div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="class_node.html#a15b31ec3be471e9e046f48517e2963aa">receivedPdusOrTokensCount</a> &gt; 1) {</div>
<div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;        <a class="code" href="class_node.html#aec183b66f5f92e8cae4f3a1269e1316c">lastJitter</a> = <a class="code" href="class_node.html#a35475c10b6c54bc85c2ce15fb5ea042d">lastDelay</a> - <a class="code" href="class_node.html#a9e1c05e3d8fbb3e4348418a60e512591">previousDelay</a>;</div>
<div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;        <a class="code" href="class_node.html#a4a5f15b9aed15145bbe65b61a30cdc67">sumJitter</a> += <a class="code" href="class_node.html#aec183b66f5f92e8cae4f3a1269e1316c">lastJitter</a>;</div>
<div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;        <a class="code" href="class_node.html#a35637af5cd80cfe72376d43f16b64f19">meanJitter</a> = <a class="code" href="class_node.html#a4a5f15b9aed15145bbe65b61a30cdc67">sumJitter</a> / (<a class="code" href="class_node.html#a15b31ec3be471e9e046f48517e2963aa">receivedPdusOrTokensCount</a> - 1); <span class="comment">// Number of measured jitters is equal to count of PDUs - 1.</span></div>
<div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;    }</div>
<div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;}</div>
<div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;</div>
<div class="line"><a name="l00290"></a><span class="lineno"><a class="line" href="class_node.html#a2adf03fc3b1465b929d29eb36f574c75">  290</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_node.html#af7467aafc77bd9d430ca329e931ade5a">Node::updateForwardingStatistics</a>(std::shared_ptr&lt;ProtocolDataUnit&gt; pdu) {</div>
<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;    ++<a class="code" href="class_node.html#a0fb081dd5928c91756f9faf672dafb35">forwardedPdusOrTokensCount</a>;</div>
<div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;    <a class="code" href="class_node.html#a3423410395300339105d6148290148cc">forwardedBytesCount</a> += pdu-&gt;getPduSize();</div>
<div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;}</div>
<div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;</div>
<div class="line"><a name="l00311"></a><span class="lineno"><a class="line" href="class_node.html#ae9f5e321e4dfb45e444e007607867737">  311</a></span>&#160;<a class="code" href="_node_return_type_8h.html#a653f4b3757de7a3613c60211493c60c1">NodeReturnType</a> <a class="code" href="class_node.html#ae9f5e321e4dfb45e444e007607867737">Node::updateForwardHops</a>(std::shared_ptr&lt;Token&gt; token) {</div>
<div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;    <span class="comment">// Sanity check: if next == destination, there is no forwarding to be done! The token has reached its destination.</span></div>
<div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;    <span class="keywordflow">if</span> (token-&gt;next.get() == token-&gt;destination.get()) {</div>
<div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="_node_return_type_8h.html#a653f4b3757de7a3613c60211493c60c1ab9804cb278b1f322f56a216720a67eec">NodeReturnType::FINAL_DESTINATION</a>;</div>
<div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;    }</div>
<div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;    <span class="comment">// Need to check whether next hop is the current hop.</span></div>
<div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;    token-&gt;updateHopsFromExplicitRoute(shared_from_this());</div>
<div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;    <span class="keywordflow">if</span> (<span class="keyword">this</span> == token-&gt;next.get()) { <span class="comment">// Indicates that the route table begins with the source node, or there is some inconsistency...</span></div>
<div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;        <a class="code" href="class_node.html#ae9f5e321e4dfb45e444e007607867737">updateForwardHops</a>(token);  <span class="comment">// Recursion. Really? Disaster?</span></div>
<div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;    }</div>
<div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="_node_return_type_8h.html#a653f4b3757de7a3613c60211493c60c1a6491ac1bf9f296c0bd614d1b182f8932">NodeReturnType::PDU_ROUTE_UPDATED</a>;</div>
<div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;}</div>
<div class="ttc" id="class_node_html_a9a3aa1e2c2fff5cc94cb0abc36f07d31"><div class="ttname"><a href="class_node.html#a9a3aa1e2c2fff5cc94cb0abc36f07d31">Node::getReceivedBytesCount</a></div><div class="ttdeci">unsigned int getReceivedBytesCount() const </div><div class="ttdoc">Get received bytes count. </div><div class="ttdef"><b>Definition:</b> <a href="_node_8cpp_source.html#l00042">Node.cpp:42</a></div></div>
<div class="ttc" id="class_node_html_ae133a5c3fc82ca150ff95a0ac0a5da86"><div class="ttname"><a href="class_node.html#ae133a5c3fc82ca150ff95a0ac0a5da86">Node::meanDelay</a></div><div class="ttdeci">double meanDelay</div><div class="ttdoc">Mean delay as measured for all PDUs received by this node. </div><div class="ttdef"><b>Definition:</b> <a href="_node_8h_source.html#l00060">Node.h:60</a></div></div>
<div class="ttc" id="_node_return_type_8h_html_a653f4b3757de7a3613c60211493c60c1"><div class="ttname"><a href="_node_return_type_8h.html#a653f4b3757de7a3613c60211493c60c1">NodeReturnType</a></div><div class="ttdeci">NodeReturnType</div><div class="ttdoc">Node Return Type enum class. </div><div class="ttdef"><b>Definition:</b> <a href="_node_return_type_8h_source.html#l00028">NodeReturnType.h:28</a></div></div>
<div class="ttc" id="class_node_html_a9e1c05e3d8fbb3e4348418a60e512591"><div class="ttname"><a href="class_node.html#a9e1c05e3d8fbb3e4348418a60e512591">Node::previousDelay</a></div><div class="ttdeci">double previousDelay</div><div class="ttdoc">Delay measured for previous PDU (the PDU before the current received one) received by this node...</div><div class="ttdef"><b>Definition:</b> <a href="_node_8h_source.html#l00064">Node.h:64</a></div></div>
<div class="ttc" id="class_node_html_a35637af5cd80cfe72376d43f16b64f19"><div class="ttname"><a href="class_node.html#a35637af5cd80cfe72376d43f16b64f19">Node::meanJitter</a></div><div class="ttdeci">double meanJitter</div><div class="ttdoc">Mean jitter as measured for all PDUs received by this node. </div><div class="ttdef"><b>Definition:</b> <a href="_node_8h_source.html#l00063">Node.h:63</a></div></div>
<div class="ttc" id="class_node_html_af48f6ec6fd6ea43523f139c5d5ff3cdd"><div class="ttname"><a href="class_node.html#af48f6ec6fd6ea43523f139c5d5ff3cdd">Node::receivedBytesCount</a></div><div class="ttdeci">unsigned int receivedBytesCount</div><div class="ttdoc">Count of received bytes by this node. </div><div class="ttdef"><b>Definition:</b> <a href="_node_8h_source.html#l00053">Node.h:53</a></div></div>
<div class="ttc" id="class_node_html_a6f36f9c793310fa1342479d3ee99afcf"><div class="ttname"><a href="class_node.html#a6f36f9c793310fa1342479d3ee99afcf">Node::getSumPduOrTokenDelay</a></div><div class="ttdeci">double getSumPduOrTokenDelay() const </div><div class="ttdoc">Get Sum of all measured PDU delays. </div><div class="ttdef"><b>Definition:</b> <a href="_node_8cpp_source.html#l00096">Node.cpp:96</a></div></div>
<div class="ttc" id="_node_return_type_8h_html_a653f4b3757de7a3613c60211493c60c1a6491ac1bf9f296c0bd614d1b182f8932"><div class="ttname"><a href="_node_return_type_8h.html#a653f4b3757de7a3613c60211493c60c1a6491ac1bf9f296c0bd614d1b182f8932">NodeReturnType::PDU_ROUTE_UPDATED</a></div><div class="ttdoc">Node is not final destination; route information was updated within PDU/token, to be forwarded...</div></div>
<div class="ttc" id="class_node_html_a15b31ec3be471e9e046f48517e2963aa"><div class="ttname"><a href="class_node.html#a15b31ec3be471e9e046f48517e2963aa">Node::receivedPdusOrTokensCount</a></div><div class="ttdeci">unsigned int receivedPdusOrTokensCount</div><div class="ttdoc">Count of received PDUs by this node (packets for network PDUs, for example). </div><div class="ttdef"><b>Definition:</b> <a href="_node_8h_source.html#l00054">Node.h:54</a></div></div>
<div class="ttc" id="class_node_html_a6a54b09eb2ba1cc137ab23a4766c4960"><div class="ttname"><a href="class_node.html#a6a54b09eb2ba1cc137ab23a4766c4960">Node::droppedPdusOrTokensCount</a></div><div class="ttdeci">unsigned int droppedPdusOrTokensCount</div><div class="ttdoc">Count of dropped PDUs by this node. </div><div class="ttdef"><b>Definition:</b> <a href="_node_8h_source.html#l00057">Node.h:57</a></div></div>
<div class="ttc" id="class_node_html_a3f388ac2e7209056fbc0988419b1d667"><div class="ttname"><a href="class_node.html#a3f388ac2e7209056fbc0988419b1d667">Node::getLastPduOrTokenJitter</a></div><div class="ttdeci">double getLastPduOrTokenJitter() const </div><div class="ttdoc">Get jitter (difference between delays) as measured between last two PDUs. </div><div class="ttdef"><b>Definition:</b> <a href="_node_8cpp_source.html#l00114">Node.cpp:114</a></div></div>
<div class="ttc" id="class_node_html_a31099ef50497ea806ea588c879ef22e1"><div class="ttname"><a href="class_node.html#a31099ef50497ea806ea588c879ef22e1">Node::getDroppedPdusOrTokensCount</a></div><div class="ttdeci">unsigned int getDroppedPdusOrTokensCount() const </div><div class="ttdoc">Get dropped PDUs count. </div><div class="ttdef"><b>Definition:</b> <a href="_node_8cpp_source.html#l00078">Node.cpp:78</a></div></div>
<div class="ttc" id="class_simulator_globals_html_a08da82e86d7c26d8f2498bd313f0e66e"><div class="ttname"><a href="class_simulator_globals.html#a08da82e86d7c26d8f2498bd313f0e66e">SimulatorGlobals::getCurrentAbsoluteTime</a></div><div class="ttdeci">double getCurrentAbsoluteTime() const </div><div class="ttdef"><b>Definition:</b> <a href="_simulator_globals_8cpp_source.html#l00070">SimulatorGlobals.cpp:70</a></div></div>
<div class="ttc" id="class_node_html_aea1a8c07cd8b785dcd2d872392b9e630"><div class="ttname"><a href="class_node.html#aea1a8c07cd8b785dcd2d872392b9e630">Node::getMeanPduOrTokenDelay</a></div><div class="ttdeci">double getMeanPduOrTokenDelay() const </div><div class="ttdoc">Get mean of all measured PDU delays. </div><div class="ttdef"><b>Definition:</b> <a href="_node_8cpp_source.html#l00105">Node.cpp:105</a></div></div>
<div class="ttc" id="class_node_html_a3423410395300339105d6148290148cc"><div class="ttname"><a href="class_node.html#a3423410395300339105d6148290148cc">Node::forwardedBytesCount</a></div><div class="ttdeci">unsigned int forwardedBytesCount</div><div class="ttdoc">Count of forwarded bytes from this node to next Entity. </div><div class="ttdef"><b>Definition:</b> <a href="_node_8h_source.html#l00056">Node.h:56</a></div></div>
<div class="ttc" id="class_node_html_aec183b66f5f92e8cae4f3a1269e1316c"><div class="ttname"><a href="class_node.html#aec183b66f5f92e8cae4f3a1269e1316c">Node::lastJitter</a></div><div class="ttdeci">double lastJitter</div><div class="ttdoc">Jitter measured between the last two PDUs received by this node. </div><div class="ttdef"><b>Definition:</b> <a href="_node_8h_source.html#l00061">Node.h:61</a></div></div>
<div class="ttc" id="class_node_html_a20dfdbde07dfa9499ba12c66407ef696"><div class="ttname"><a href="class_node.html#a20dfdbde07dfa9499ba12c66407ef696">Node::getLastPduOrTokenDelay</a></div><div class="ttdeci">double getLastPduOrTokenDelay() const </div><div class="ttdoc">Get last PDU measured delay. </div><div class="ttdef"><b>Definition:</b> <a href="_node_8cpp_source.html#l00087">Node.cpp:87</a></div></div>
<div class="ttc" id="class_node_html_abe5523d6e76ecfec5bd09ca388ee5873"><div class="ttname"><a href="class_node.html#abe5523d6e76ecfec5bd09ca388ee5873">Node::getMeanPduOrTokenJitter</a></div><div class="ttdeci">double getMeanPduOrTokenJitter() const </div><div class="ttdoc">Get Mean of all measured jitters (difference between delays). </div><div class="ttdef"><b>Definition:</b> <a href="_node_8cpp_source.html#l00132">Node.cpp:132</a></div></div>
<div class="ttc" id="class_node_html_a4a5f15b9aed15145bbe65b61a30cdc67"><div class="ttname"><a href="class_node.html#a4a5f15b9aed15145bbe65b61a30cdc67">Node::sumJitter</a></div><div class="ttdeci">double sumJitter</div><div class="ttdoc">Sum of jitters measured for all PDUs received by this node. </div><div class="ttdef"><b>Definition:</b> <a href="_node_8h_source.html#l00062">Node.h:62</a></div></div>
<div class="ttc" id="_node_return_type_8h_html_a653f4b3757de7a3613c60211493c60c1ab9804cb278b1f322f56a216720a67eec"><div class="ttname"><a href="_node_return_type_8h.html#a653f4b3757de7a3613c60211493c60c1ab9804cb278b1f322f56a216720a67eec">NodeReturnType::FINAL_DESTINATION</a></div><div class="ttdoc">This node is the final destination. Stats updated, nothing else to do in node. </div></div>
<div class="ttc" id="class_node_html_aa433297c5f2e8f74c5a999e429eada60"><div class="ttname"><a href="class_node.html#aa433297c5f2e8f74c5a999e429eada60">Node::Node</a></div><div class="ttdeci">Node(SimulatorGlobals &amp;simulatorGlobals)</div><div class="ttdoc">Default constructor. </div><div class="ttdef"><b>Definition:</b> <a href="_node_8cpp_source.html#l00030">Node.cpp:30</a></div></div>
<div class="ttc" id="class_node_html_a4b1e673f06404a5197429a352c2154b2"><div class="ttname"><a href="class_node.html#a4b1e673f06404a5197429a352c2154b2">Node::getReceivedPdusOrTokensCount</a></div><div class="ttdeci">unsigned int getReceivedPdusOrTokensCount() const </div><div class="ttdoc">Get received PDUs count. </div><div class="ttdef"><b>Definition:</b> <a href="_node_8cpp_source.html#l00051">Node.cpp:51</a></div></div>
<div class="ttc" id="_node_8h_html"><div class="ttname"><a href="_node_8h.html">Node.h</a></div></div>
<div class="ttc" id="class_node_html_a0fb081dd5928c91756f9faf672dafb35"><div class="ttname"><a href="class_node.html#a0fb081dd5928c91756f9faf672dafb35">Node::forwardedPdusOrTokensCount</a></div><div class="ttdeci">unsigned int forwardedPdusOrTokensCount</div><div class="ttdoc">Count of forwarded PDUs from this node to next Entity. </div><div class="ttdef"><b>Definition:</b> <a href="_node_8h_source.html#l00055">Node.h:55</a></div></div>
<div class="ttc" id="class_node_html_ac5b0a78b84737a4bf4adffbcbc0755ab"><div class="ttname"><a href="class_node.html#ac5b0a78b84737a4bf4adffbcbc0755ab">Node::updateArrivalStatistics</a></div><div class="ttdeci">void updateArrivalStatistics(std::shared_ptr&lt; Token &gt; token)</div><div class="ttdoc">Update Node statistics upon arrival of token. </div><div class="ttdef"><b>Definition:</b> <a href="_node_8cpp_source.html#l00236">Node.cpp:236</a></div></div>
<div class="ttc" id="class_node_html_a579cc4fb0789a1de48fb56ae99d7385a"><div class="ttname"><a href="class_node.html#a579cc4fb0789a1de48fb56ae99d7385a">Node::sumDelay</a></div><div class="ttdeci">double sumDelay</div><div class="ttdoc">Sum of delays measured for all PDUs received by this node. </div><div class="ttdef"><b>Definition:</b> <a href="_node_8h_source.html#l00059">Node.h:59</a></div></div>
<div class="ttc" id="class_node_html_a14540911910efef23e01ec6ad881b843"><div class="ttname"><a href="class_node.html#a14540911910efef23e01ec6ad881b843">Node::simulatorGlobals</a></div><div class="ttdeci">SimulatorGlobals &amp; simulatorGlobals</div><div class="ttdoc">Reference to SimulatorGlobals object, to get clock time. </div><div class="ttdef"><b>Definition:</b> <a href="_node_8h_source.html#l00065">Node.h:65</a></div></div>
<div class="ttc" id="class_node_html_af7467aafc77bd9d430ca329e931ade5a"><div class="ttname"><a href="class_node.html#af7467aafc77bd9d430ca329e931ade5a">Node::updateForwardingStatistics</a></div><div class="ttdeci">void updateForwardingStatistics(std::shared_ptr&lt; Token &gt; token)</div><div class="ttdoc">Update Node statistics upon forwarding of token. </div><div class="ttdef"><b>Definition:</b> <a href="_node_8cpp_source.html#l00258">Node.cpp:258</a></div></div>
<div class="ttc" id="class_simulator_globals_html"><div class="ttname"><a href="class_simulator_globals.html">SimulatorGlobals</a></div><div class="ttdoc">Simulator-scope variables and parameters. </div><div class="ttdef"><b>Definition:</b> <a href="_simulator_globals_8h_source.html#l00044">SimulatorGlobals.h:44</a></div></div>
<div class="ttc" id="class_node_html_a95ef71aa24da2ed22f1da017d27602ac"><div class="ttname"><a href="class_node.html#a95ef71aa24da2ed22f1da017d27602ac">Node::getSumPduOrTokenJitter</a></div><div class="ttdeci">double getSumPduOrTokenJitter() const </div><div class="ttdoc">Get sum of all measured jitters (difference between delays). </div><div class="ttdef"><b>Definition:</b> <a href="_node_8cpp_source.html#l00123">Node.cpp:123</a></div></div>
<div class="ttc" id="class_node_html_a3dada83d831807c17f41b76395759c6e"><div class="ttname"><a href="class_node.html#a3dada83d831807c17f41b76395759c6e">Node::getForwardedBytesCount</a></div><div class="ttdeci">unsigned int getForwardedBytesCount() const </div><div class="ttdoc">Get forwarded PDUs count. </div><div class="ttdef"><b>Definition:</b> <a href="_node_8cpp_source.html#l00069">Node.cpp:69</a></div></div>
<div class="ttc" id="class_node_html_a56b7b2497ac364efe0719ea219d98b9e"><div class="ttname"><a href="class_node.html#a56b7b2497ac364efe0719ea219d98b9e">Node::getForwardedPdusOrTokensCount</a></div><div class="ttdeci">unsigned int getForwardedPdusOrTokensCount() const </div><div class="ttdoc">Get forwarded PDUs count. </div><div class="ttdef"><b>Definition:</b> <a href="_node_8cpp_source.html#l00060">Node.cpp:60</a></div></div>
<div class="ttc" id="class_node_html_a2cb2a58f1d3477a30e863e59b1dbc3e2"><div class="ttname"><a href="class_node.html#a2cb2a58f1d3477a30e863e59b1dbc3e2">Node::processAndForward</a></div><div class="ttdeci">NodeReturnType processAndForward(std::shared_ptr&lt; Token &gt; token)</div><div class="ttdoc">Process the token by updating statistics and other procedures. Then, &amp;quot;forward&amp;quot; the token by changing ...</div><div class="ttdef"><b>Definition:</b> <a href="_node_8cpp_source.html#l00149">Node.cpp:149</a></div></div>
<div class="ttc" id="class_node_html_ae9f5e321e4dfb45e444e007607867737"><div class="ttname"><a href="class_node.html#ae9f5e321e4dfb45e444e007607867737">Node::updateForwardHops</a></div><div class="ttdeci">NodeReturnType updateForwardHops(std::shared_ptr&lt; Token &gt; token)</div><div class="ttdoc">Update token&amp;#39;s or PDU&amp;#39;s hop fields to prepare it for forwarding, according to explicit route attached...</div><div class="ttdef"><b>Definition:</b> <a href="_node_8cpp_source.html#l00311">Node.cpp:311</a></div></div>
<div class="ttc" id="_node_return_type_8h_html_a653f4b3757de7a3613c60211493c60c1a6a9d501110e3a79a73c88afceef39905"><div class="ttname"><a href="_node_return_type_8h.html#a653f4b3757de7a3613c60211493c60c1a6a9d501110e3a79a73c88afceef39905">NodeReturnType::TTL_EXCEEDED_PDU_DISCARDED</a></div><div class="ttdoc">TTL for this PDU has exceeded. Nothing done. </div></div>
<div class="ttc" id="class_node_html_a35475c10b6c54bc85c2ce15fb5ea042d"><div class="ttname"><a href="class_node.html#a35475c10b6c54bc85c2ce15fb5ea042d">Node::lastDelay</a></div><div class="ttdeci">double lastDelay</div><div class="ttdoc">Delay measured for last PDU received by this node. </div><div class="ttdef"><b>Definition:</b> <a href="_node_8h_source.html#l00058">Node.h:58</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Nov 14 2013 11:18:20 for QCNSim by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>
